set terminal epslatex color standalone lw 1 header '\renewcommand{\normalsize}{\scriptsize}  \usepackage{txfonts} \newcommand{\dd}{\mathrm{d}}'
set output"M_vir_tmc4.tex"
set label 1 "TMC" at graph 0.1,0.9
power(x)=a*(x**p)    
fit [0.05:40] power(x) 'tmc_m.txt' using 9:10 via 'power.par'
yequal(x)=x
set ylabel offset 3,0
set key box
set key width -23
set key height 0.4
set xrange [0.07:40]
set yrange [1:100]
set logscale xy
unset key
set xlabel '$M_{LTE}\ (M_\odot)$'
set ylabel '$M_{vir}\ (M_\odot)$'
plot"tmc_m.txt" using 9:10 w p pt 19 title "Data" , power(x) with line lt 1  title \
'$\frac{M_{vir}}{M_{\odot}}=(22.9\pm 2.7)\left(\frac{M_{LTE}}{M_{\odot}}\right)^{0.39\pm 0.04},\ R^2=0.77$',\
yequal(x) with line lt 4 title '$M_{LTE}=M_{vir}$'


#After 6 iterations the fit converged.
#final sum of squares of residuals : 429.305
#rel. change during last iteration : -4.32618e-009
#
#degrees of freedom    (FIT_NDF)                        : 14
#rms of residuals      (FIT_STDFIT) = sqrt(WSSR/ndf)    : 5.53756
#variance of residuals (reduced chisquare) = WSSR/ndf   : 30.6646
#
#Final set of parameters            Asymptotic Standard Error
#=======================            ==========================
#
#a               = 20.6309          +/- 1.584        (7.68%)
#p               = 0.426067         +/- 0.05714      (13.41%)
#
#
#correlation matrix of the fit parameters:
#
#               a      p      
#a               1.000 
#p              -0.639  1.000 

set output"M_j_tmc4.tex"
line(x)= k*x+b
power(x)=a*(x**p)    
fit [0:150] power(x) 'tmc_m.txt' using 9:11 via 'power.par'
set xlabel '$M_{LTE}\ (M_\odot)$'
set ylabel '$M_{J}\ (M_\odot)$'
plot"tmc_m.txt" using 9:11 w p pt 19 title "Data" , power(x) with line lt 1  title \
 '$\frac{M_{J}}{M_{\odot}}=(17.0\pm 2.8)\left(\frac{M_{LTE}}{M_{\odot}}\right)^{0.35\pm 0.06},\ R^2=0.75$',\
yequal(x) with line lt 4 title '$M_{LTE}=M_{J}$'
set terminal wxt enhanced
set output


#After 6 iterations the fit converged.
#final sum of squares of residuals : 545.222
#rel. change during last iteration : -2.49177e-006
#
#degrees of freedom    (FIT_NDF)                        : 14
#rms of residuals      (FIT_STDFIT) = sqrt(WSSR/ndf)    : 6.24055
#variance of residuals (reduced chisquare) = WSSR/ndf   : 38.9445
#
#Final set of parameters            Asymptotic Standard Error
#=======================            ==========================
#
#a               = 17.277           +/- 1.619        (9.37%)
#p               = 0.222437         +/- 0.07516      (33.79%)
#
#
#correlation matrix of the fit parameters:
#
#               a      p      
#a               1.000 
#p              -0.275  1.000 

set terminal epslatex color standalone lw 1 header '\renewcommand{\normalsize}{\scriptsize}  \usepackage{txfonts} \newcommand{\dd}{\mathrm{d}}'
set output"M_vir_cmc4.tex"
set label 1 "CMC" at graph 0.1,0.9
power(x)=a*(x**p)    
fit [0.05:150] power(x) 'cmc_m.txt' using 9:10 via 'power.par'
yequal(x)=x
set ylabel offset 3,0
set key box
set key width -23
set key height 0.4
set xrange [1:150]
set yrange [10:400]
set logscale xy
unset key
set xlabel '$M_{LTE}\ (M_\odot)$'
set ylabel '$M_{vir}\ (M_\odot)$'
plot"cmc_m.txt" using 9:10 w p pt 19 title "Data" , power(x) with line lt 1  title \
'$\frac{M_{vir}}{M_{\odot}}=(22.9\pm 2.7)\left(\frac{M_{LTE}}{M_{\odot}}\right)^{0.39\pm 0.04},\ R^2=0.77$',\
yequal(x) with line lt 4 title '$M_{LTE}=M_{vir}$'

#After 69 iterations the fit converged.
#final sum of squares of residuals : 7694.47
#rel. change during last iteration : -1.13185e-007
#
#degrees of freedom    (FIT_NDF)                        : 8
#rms of residuals      (FIT_STDFIT) = sqrt(WSSR/ndf)    : 31.013
#variance of residuals (reduced chisquare) = WSSR/ndf   : 961.809
#
#Final set of parameters            Asymptotic Standard Error
#=======================            ==========================
#
#a               = 17.2913          +/- 11.18        (64.64%)
#p               = 0.539311         +/- 0.1766       (32.74%)
#
#
#correlation matrix of the fit parameters:
#
#               a      p      
#a               1.000 
#p              -0.990  1.000 0 


set output"M_j_cmc4.tex"
line(x)= k*x+b
power(x)=a*(x**p)  
set xrange [1:150]
set yrange [10:400]  
fit [1:150] power(x) 'cmc_m.txt' using 9:11 via 'power.par'
set xlabel '$M_{LTE}\ (M_\odot)$'
set ylabel '$M_{J}\ (M_\odot)$'
plot"cmc_m.txt" using 9:11 w p pt 19 title "Data" , power(x) with line lt 1  title \
 '$\frac{M_{J}}{M_{\odot}}=(17.0\pm 2.8)\left(\frac{M_{LTE}}{M_{\odot}}\right)^{0.35\pm 0.06},\ R^2=0.75$',\
yequal(x) with line lt 4 title '$M_{LTE}=M_{J}$'
set terminal wxt enhanced
set output

#After 52 iterations the fit converged.
#final sum of squares of residuals : 4613.48
#rel. change during last iteration : -2.94775e-006
#
#degrees of freedom    (FIT_NDF)                        : 8
#rms of residuals      (FIT_STDFIT) = sqrt(WSSR/ndf)    : 24.0143
#variance of residuals (reduced chisquare) = WSSR/ndf   : 576.685
#
#Final set of parameters            Asymptotic Standard Error
#=======================            ==========================
#
#a               = 19.4844          +/- 14.55        (74.65%)
#p               = 0.274332         +/- 0.2139       (77.98%)
#
#
#correlation matrix of the fit parameters:
#
#               a      p      
#a               1.000 
#p              -0.976  1.000  
